const apiPath = '/cmsServer/admin/api';
const cms = {
  graphQL: {
    // 查询帮助文档
    queryBanners: {
      url: apiPath,
      query: 'query allAppBanners($appid: String){allAppBanners(orderBy: "order_ASC" where: {state: published app:{appid:$appid}}){id name app{name appid} image{publicUrl}}}',
      column: 'allAppBanners',
    },
    // 查询帮助文档
    queryHelps: {
      url: apiPath,
      query: 'query allQuestions($appid: String){allHelps(orderBy: "order_ASC" where: {state: published app:{appid:$appid}}){id name type{name id} recommend doc{publicUrl}}}',
      column: 'allHelps',
    },

    // 查询帮助文档详情
    // variables: $id -- 文章ID
    queryHelpDetail: {
      url: apiPath,
      query: 'query Help($id: ID!){Help(where:{id:$id}){id name type{name id} author content1 content2 content3 content4 content5 media1{publicUrl} media2{publicUrl} media3{publicUrl} media4{publicUrl} doc{publicUrl}}}',
      column: 'Help',
    },
    // 查询外部页面列表
    // $count -- 数量 $skip -- 从第几条开始
    queryOuterPageList: {
      url: apiPath,
      query: 'query allOuterPages($count: Int,$skip: Int){ allOuterPages(first: $count skip: $skip where:{state: published}) {id name author summary } _allOuterPagesMeta(where: {state:published}) {count}}',
      column: 'allOuterPages',
      metaColumn: '_allOuterPagesMeta',
    },
    // 查询外部页面详情
    // variables: $id -- 文章ID
    queryOuterPageDetail: {
      url: apiPath,
      query: 'query OuterPage($id: ID!){ OuterPage(where:{id:$id}) {id name author summary content }}',
      column: 'OuterPage',
    }
  },
};
export default cms
